<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<title>天天美印</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="bootstrap.min.js"></script>
	<script type="text/javascript" src="hammer.min.js"></script>
	<link type="text/css" rel="stylesheet" href="common.css" />	
	<link type="text/css" rel="stylesheet" href="bootstrap.min.css" />
	<style type="text/css">
		ul,li{
			padding:0;
			margin:0;
		}
		body{
			/*background:#f2f2f2;*/
		}

		/*main css*/
		#main{
			width:100%;
		}
		div#count ul li{
			padding:8px 12px;
			font-size:1.6rem;
			border-bottom:1px solid #cdcdcd;
			color:#040404;
		}
		div#count ul li span{
			color:#cf519b;
			font-size:2rem;
			margin-left:15px;
			display: inline-block;
		}
		div#count ul li span:first-letter{
			font-size:1.6rem;
		}
		div#iconsRecords ul li{
			padding:8px 12px;
			font-size:1.5rem;
			border-bottom:1px solid #cdcdcd;
			color:#040404;
			position: relative;
		}
		div#iconsRecords ul li div:first-child{
			margin-bottom:8px;
		}
		div#iconsRecords ul li div:first-child span{
			margin-left:5px;
		}
		div#iconsRecords ul li a{
			text-decoration: none;
			color:#cf519b;
			font-size:2rem;
			position: absolute;
			top:20px;
			right:25px;
		}
	</style>
</head>
<body>
	
	<div id="main">
		<div id="count">
			<ul>
				<li>可用币额：<span id="tobeused">￥0</span></li>
				<li>已使用币额：<span id="used">￥0</span></li>
			</ul>
		</div>
		<div id="iconsRecords">
			<ul>
				<!-- <li>
					<div>美印币<span>2015-10-27</span></div>
					<div>新用户注册</div>
					<a>￥5</a>
				</li>
				<li>
					<div>美印币<span>2015-10-27</span></div>
					<div>通过分享到大家归秀获得</div>
					<a>￥5</a>
				</li>
			</ul> -->
		</div>
	</div>
	<div id="footer">
		
	</div>
</body>
<script type="text/javascript">
    
	$(document).ready(function(){
		// $("ul li:after").css("margin-top",$("ul li img").height());
		var uid = api.getUid("uid");

		$.ajax({
            url:"http://ttmy.len.so/app/user/myscore/uid/"+uid, 
            type:'get',
            dataType:'JSONP',
            jsonp:"callback",
            success: function(data){
                
                console.log(data);
                //alert(JSON.stringify(data))
	            if(data.status==1){
	                $("#tobeused").html("￥"+data.score);
	                $("#used").html("￥"+data.used);
               var scores = 0;
	                for(var i in data.list){
	                  	var list = data.list[i];
	                  	listli='<li >'+
								'<div>美印币 '+list.create_time+'</div>'+
								'<div>'+list.detail+'</div>'+
								'<a>￥'+list.score+'</a>'+
							'</li>';
               scores = parseInt(scores)+parseInt(list.score);
               
	                  	$("#iconsRecords ul").append(listli);
	                }
              // alert(scores);

	                
	            }
	            
	        }
        })
	})

 	function bindEvent () {
	  	var mc = new Hammer.Manager(document.body);
	    mc.add(new Hammer.Tap());
	    
	    mc.on("tap", function (e) {
	    	
	        var className=$(e.target).attr("class");

	        // if(e.target.id=="btn-login"){
	        // 	window.location.href=$(e.target).attr("data")+".html";
	        // }

	    });
	}
	bindEvent();
</script>
</html>